public class Solution {
    public int jumpFloorII(int target) {
        
        //1.递归方式
        //if(target == 1) return 1;
        //return 2 * jumpFloorII(target-1);
        
        
        //2.循环
        if(target == 1) return 1;
        int f1 = 1;
        int f2 = 0;
        for(int i = 2; i <= target; i++){
            f2 = 2*f1;
            f1 = f2;
        }
        return f2;
        
        
        //3.动态规划  状态转移方程dp[i] = 2*dp[i-1]表示n级台阶跳法是n-1台阶跳法的两倍
        //int[] dp = new int[target+1];
        //dp[1] = 1;
        //for(int i = 2; i <= target; i++){
        //    dp[i] = 2*dp[i-1];
        //}
        //return dp[target];
    }
}